###########################################
# 替换erlang
tardirs=[0]="./Betasoft/infra/rabbitmq"
tardirs=[1]="./Betasoft/platform/btdgo/server_rabbitmq"
tardirs=[2]="./Betasoft/platform/btpm/xafsvc_rabbitmq"
tardirs=[3]="./Betasoft/platform/dgoengine/engine_rabbitmq"

for var in ${tardirs[@]};
do
    rm -rf erl
    ln -s $native_dir/erl erl
done



############################################
# 替换nginx
cd $btcloud_home

/usr/bin/cp -f $native_dir/nginx/nginx ./btuc/nginx/
/usr/bin/cp -f $native_dir/nginx/nginx ./btso/runtime/nginx/
/usr/bin/cp -f $native_dir/nginx/nginx ./infra/nginx/beta/nginx

############################################
# pgsql

rm -rf $base_dir/pgsql

cd $base_dir
ln -s $native_dir/pgsql pgsql

#-- btpm
cd $btcloud_home/platform/btpm
rm -rf pgsql
ln -s $native_dir/pgsql pgsql

#-- btso
cd $btcloud_home/btso/runtime
rm -rf pgsql
ln -s $native_dir/pgsql pgsql

###########################################
# redis

cd $btcloud_home

/usr/bin/cp -f $native_dir/redis/* ./Betasoft/infra/redis/bin/

/usr/bin/cp -f $native_dir/redis/* ./Betasoft/platform/btdgo/server_redis/
/usr/bin/cp -f $native_dir/redis/* ./Betasoft/platform/btpm/xafsvc_redis/
/usr/bin/cp -f $native_dir/redis/* ./Betasoft/platform/dgoengine/engine_redis/

###########################################
# gomaster

cd $btcloud_home
/usr/bin/cp -f $native_dir/gomaster/gomaster ./infra/gomaster/beta/gomaster

###########################################
# goagent

cd $btcloud_home
/usr/bin/cp -f $native_dir/goagent/goagent ./base/goagent/beta/goagent


###########################################
# grafana

cd $btcloud_home/btso/runtime
/usr/bin/cp -r $native_dir/grafana/* ./grafana/

###########################################
echo done


